const Compile = require('./compile');
const Hijack = require('./hijack');
const Notice = require('./notice');

class Mue {
	constructor(options = {}) {
		this.$options = options;
		this.$notice = new Notice();
		this.data = options.data || {};
		const el = options.el;
		this.proxyData();
		new Hijack(this);
		new Compile(el, this);
	}
	proxyData() {
		Object.keys(this.data).forEach(key => {
			Object.defineProperty(this, key, {
				configurable: true,
				get() {
					return this.data[key];
				},
				set(newVal) {
					this.data[key] = newVal;
				}
			});
		});
	}
}

module.exports = Mue;


